#-*- codeing = utf-8 -*-
#@Time : 2020/11/25 20:12
#@Author : 阳某
#@File : 17.装饰器.py
#@Software : PyCharm

import time

# 定义一个装饰器函数
def sayLocal(func):
    def wrapper():
        curTime = func()
        return f'当地时间： {curTime}'
    return wrapper

def getXXXTime():
    return time.strftime('%Y_%m_%d %H:%M:%S',time.localtime())

# print (getXXXTime())
# 装饰 getXXXTime
getXXXTime = sayLocal(getXXXTime)
print (getXXXTime())




import time

def sayLocal(func):
    def wrapper():
        curTime = func()
        return f'当地时间： {curTime}'
    return wrapper

@sayLocal
def getXXXTime():
    return time.strftime('%Y_%m_%d %H:%M:%S',time.localtime())

print (getXXXTime())